//2009/08/15 16:13:59
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class ExperimentalAnalyzer
{
public:
    vector <int> getPredictors(vector <string> data)
    {
		vector<int> a, res;
		vector<vector<int> > b;
		int n = data.size(), m;
		b.resize(n);
		for(int i=0; i<n; i++)
		{
			stringstream ss(data[i]);
			int t; ss >> t; a.push_back(t);
			while(ss >> t) b[i].push_back(t);
		}
		m = b[0].size();
		for(int i=0; i<b[0].size(); i++)
		{
			int min0, min1, max0, max1;
			min0 = min1 = max0 = max1 = -1;
			for(int j=0; j<n; j++)
			{
				if(a[j])
				{
					if(min0 == -1 || b[j][i] < min0) min0 = b[j][i];
					if(max0 == -1 || b[j][i] > max0) max0 = b[j][i];
				}
				else
				{
					if(min1 == -1 || b[j][i] < min1) min1 = b[j][i];
					if(max1 == -1 || b[j][i] > max1) max1 = b[j][i];
				}
			}
			if(min0 != -1 && min1 != -1 && (max0 < min1 || max1 < min0) )
				res.push_back(i+1);
		}
		return res;
    }
};
